package day0802;

import javax.swing.*;

//敌方小飞机类：
public class SmallPlane extends FlyingObject {
    //1.属性

    //2.方法
    public void move(){
        y= y+speed;
    }

    SmallPlane(){
        speed=2;
        ImageIcon iconImg=new ImageIcon("images/airplane0.png");
        img=iconImg.getImage();//getImage方法：将ImageIcon转化为Image类型
        imgWidth=iconImg.getIconWidth();
        imgHeight=iconImg.getIconHeight();
        x=(int)(Math.random()*420-imgWidth/2)-imgWidth/2;
        y=-20;
    }

}


